package io.scnb.lesson001.demo3;

/**
 * 通过实例工厂方法创建bean对象
 */
public class UserFactory {

    public UserModel buildUser1() {
        System.out.println("-------------1");
        UserModel userModel = new UserModel();
        userModel.setName("bean实例方法创建的对象");
        return userModel;
    }

    public UserModel buildUser2(String name, int age) {
        System.out.println("-------------2");
        UserModel userModel = new UserModel();
        userModel.setName(name);
        userModel.setAge(age);
        return userModel;
    }
}
